{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "04a587e7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "i\n",
      "i\n",
      "a\n"
     ]
    }
   ],
   "source": [
    "vowels=['a','e','i','o','u']\n",
    "word=\"Milliways\"\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "        print(letter)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5acedcd4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found=[]\n",
    "len(found)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "907fa7b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a']"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found.append('a')\n",
    "len(found)\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "88c67e58",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'e']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found.append('e')\n",
    "len(found)\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "eadf2041",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'e', 'u']"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "if 'u' not in found:\n",
    "    found.append('u')\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9d257606",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "i\n",
      "a\n"
     ]
    }
   ],
   "source": [
    "vowels=['a','e','i','o','u']\n",
    "word=\"Milliways\"\n",
    "found=[]\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "        if letter not in found:\n",
    "            found.append(letter)\n",
    "for vowel in found:\n",
    "        print(vowel)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ad64da4b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "provide a word to search for vowels:a \n",
      "a\n"
     ]
    }
   ],
   "source": [
    "vowels=['a','e','i','o','u']\n",
    "word=input(\"provide a word to search for vowels:\")\n",
    "found=[]\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "        if letter not in found:\n",
    "            found.append(letter)\n",
    "for vowel in found:\n",
    "        print(vowel)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ec61c9dd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 4]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums=[1,2,3,4]\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "6110ca6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 4]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums.remove(3)\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "3fb3c41a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums.pop()\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f0117f92",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[2]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums.pop(0)\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b8424633",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[2, 3, 4, 3, 4, 3, 4]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums.extend([3,4])\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "3221d2b7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 1, 2, 3, 4, 3, 4, 3, 4]\n"
     ]
    }
   ],
   "source": [
    "nums.insert(0,1)\n",
    "print(nums)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "7a120520",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 1, 'two-and-a-half', 2, 3, 4, 3, 4, 3, 4]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nums.insert(2,\"two-and-a-half\")\n",
    "nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "e5e3b49e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "don't panic!\n",
      "['d', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n"
     ]
    }
   ],
   "source": [
    "phrase=\"don't panic!\"\n",
    "plist=list(phrase)\n",
    "print(phrase)\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "83ff730a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['d', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "don't panic!\n"
     ]
    }
   ],
   "source": [
    "new_phrase=''.join(plist)\n",
    "print(plist)\n",
    "print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "7c6d9bd7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "don't panic!\n",
      "['d', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', ' ', 't', 'a', 'p']\n",
      "on tap\n"
     ]
    }
   ],
   "source": [
    "phrase=\"don't panic!\"\n",
    "plist=list(phrase)\n",
    "print(phrase)\n",
    "print(plist)\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "plist.pop(0)\n",
    "plist.remove(\"'\")\n",
    "plist.extend([plist.pop(),plist.pop()])\n",
    "plist.insert(2,plist.pop(3))\n",
    "new_phrase=''.join(plist)\n",
    "print(plist)\n",
    "print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1cae9995",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
